chore: adopt Vite+ (vp) for the JS toolchain#417
Open
fengmk2 wants to merge 5 commits into
Open
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Dogfood run of vp migrate + vp config against this repo, on a throwaway branch. Not intended to merge: this is a Rust workspace and vp check/test/build do not replace the just/cargo workflow. Tooling: add vite.config.ts (lint + fmt blocks), drop .oxfmtrc.json (merged into fmt), swap oxfmt/oxlint/oxlint-tsgolint deps for vite-plus, redirect vite/vitest catalog to voidzero packages. Hooks + staged: replace husky + lint-staged with vp config hooks (.vite-hooks/, core.hooksPath) plus a staged block in vite.config.ts running vp fmt / vp lint / cargo fmt; prepare now runs vp config. This resolves the dangling oxfmt/oxlint lint-staged refs. Remaining migrator note: the lint block has no ignorePatterns, so a full-repo vp check type-aware lint trips over intentionally-incomplete test fixtures and the playground.
Catalog: change vite-plus, vite, and vitest from the 'latest' tag to the ^0.1.23 range. Make the vite/vitest override actually bind to @voidzero-dev/vite-plus-core / vite-plus-test by adding first-party vite/vitest devDependencies (catalog-aliased to the forks). Without a real vite dependency edge, autoInstallPeers pulled upstream vite@8.0.14 to satisfy vite-plus-test's peer and the override had nothing to rewrite. With the direct dep plus the existing overrides and peerDependencyRules.allowedVersions '*', vite/vitest now resolve to the Vite+ forks and no upstream vite remains in the lockfile.
Collapse the separate 'vp fmt' and 'vp lint --fix' staged entries into a single 'vp check --fix' for the '*' glob. vp check runs format, lint, and type-check in one pass, and '*' already matches js/ts/tsx files, so the dedicated lint entry was redundant. Verified scoped to staged files (no whole-repo type errors) and a no-op with exit 0 on .rs files.
Add lint.ignorePatterns for 'playground/**' and '**/fixtures/**'. The playground is a self-contained nested workspace whose @playground/* cross-imports only resolve inside it, and the e2e fixtures are intentionally minimal, so whole-repo type-aware vp check was emitting false TS2307/no-empty-file errors on them. This narrows lint/type-check to the repo's real first-party TS (4 files); formatting still covers all files.
fdb1f1d to
be40da7
Compare
The migration replaced standalone oxfmt/oxlint with vite-plus, whose oxfmt/oxlint bins are IDE/LSP wrappers that refuse to run as CLIs. That broke two CI jobs: 'Format and Check Deps' (pnpm oxfmt --check hit the wrapper) and 'Test' on every platform (crates/fspy/tests/oxlint.rs runs packages/tools/node_modules/.bin/oxlint and asserts it reads the JS file, but the wrapper never does). Restore oxfmt/oxlint/oxlint-tsgolint in the catalog and in packages/tools (dropping vite-plus there so its wrappers stop shadowing the real bins), and switch CI's format check to 'pnpm exec vp fmt --check'. packages/tools is a test-fixtures package that must ship the real binaries the fspy suite traces, so it cannot be migrated to vite-plus. Verified locally: vp fmt --check (522 files) and pnpm dedupe --check pass; the 3 fspy oxlint tests pass.
be40da7 to
4b695a0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Adopt Vite+ (
vp) as this repo's JavaScript toolchain, so the project behindvp rundogfoods Vite+ for its own formatting and git hooks. This replaces the rootoxfmt+husky+lint-stagedsetup withvpand consolidates tool config intovite.config.ts.Changes
oxfmtdependency and.oxfmtrc.json; format withvp fmt(config moved into thefmtblock ofvite.config.ts). CI now runspnpm exec vp fmt --check.husky+lint-stagedwithvp config(.vite-hooks/) and astagedblock that runsvp check --fix(pluscargo fmtfor Rust files).lintblock withignorePatternsforplayground/**and**/fixtures/**, so type-aware checks skip the nested playground workspace and the intentionally-incomplete test fixtures.vite/vitestto the Vite+ forks (@voidzero-dev/vite-plus-core/-test), pinned to^0.1.23.Notable decisions
packages/toolsstays on standaloneoxlint/oxfmt/oxlint-tsgolint. Thefspysuite (crates/fspy/tests/oxlint.rs) traces those real binaries' filesystem access; the Vite+oxlint/oxfmtbins are IDE/LSP wrappers and would break the tests.vite/vitestdevDeps so the catalog override has a dependency to bind to. Otherwise the onlyvitereference is a peer that pnpm satisfies with upstream vite, leaving the override a no-op.Verification
vp check,vp fmt --check, andpnpm dedupe --checkpass locally; full CI is green (format, clippy, and all test shards including thefspyoxlint tests).